package com.lzx.adx.report.support.strategy.v2.channel;

import cn.hutool.http.HttpUtil;
import com.lzx.adx.report.dto.AccountDTO;
import com.lzx.adx.report.dto.ReportDTO;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public abstract class AbstractReport<T> {


    public abstract String getReportFinalUrl(ReportDTO reportDTO, AccountDTO accountDTO);


    public String report(ReportDTO reportDTO, AccountDTO accountDTO) {
        String finalUrl =  getReportFinalUrl(reportDTO,accountDTO);

        log.info("账号为{},请求产品段的完整地址为 {}",accountDTO.getId(),finalUrl);
        //2.2调用饿了嘛，上报接口
        String body = HttpUtil.createGet(finalUrl).execute().body();
        log.info("账号为{} 请求产品端，响应的结果为{}",accountDTO.getId(),  body);

        return body;
    }




}
